package com.alax.interfaces.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.alax.common.annotation.Excel;
import com.alax.common.core.domain.BaseEntity;

/**
 * API调用统计对象 api_call_stats
 * 
 * @author alax
 * @date 2025-04-03
 */
public class ApiCallStats extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 统计ID */
    private Long id;

    /** API ID */
    @Excel(name = "API ID")
    private Long apiId;

    /** 用户ID */
    @Excel(name = "用户ID")
    private Long userId;

    /** API密钥 */
    @Excel(name = "API密钥")
    private String apiKey;

    /** 统计日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "统计日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date callDate;

    /** 总调用次数 */
    @Excel(name = "总调用次数")
    private Long totalCalls;

    /** 成功调用次数 */
    @Excel(name = "成功调用次数")
    private Long successCalls;

    /** 失败调用次数 */
    @Excel(name = "失败调用次数")
    private Long failCalls;

    /** 平均响应时间(ms) */
    @Excel(name = "平均响应时间(ms)")
    private Long avgResponseTime;

    public void setId(Long id) 
    {
        this.id = id;
    }

    public Long getId() 
    {
        return id;
    }

    public void setApiId(Long apiId) 
    {
        this.apiId = apiId;
    }

    public Long getApiId() 
    {
        return apiId;
    }

    public void setUserId(Long userId) 
    {
        this.userId = userId;
    }

    public Long getUserId() 
    {
        return userId;
    }

    public void setApiKey(String apiKey) 
    {
        this.apiKey = apiKey;
    }

    public String getApiKey() 
    {
        return apiKey;
    }

    public void setCallDate(Date callDate) 
    {
        this.callDate = callDate;
    }

    public Date getCallDate() 
    {
        return callDate;
    }

    public void setTotalCalls(Long totalCalls) 
    {
        this.totalCalls = totalCalls;
    }

    public Long getTotalCalls() 
    {
        return totalCalls;
    }

    public void setSuccessCalls(Long successCalls) 
    {
        this.successCalls = successCalls;
    }

    public Long getSuccessCalls() 
    {
        return successCalls;
    }

    public void setFailCalls(Long failCalls) 
    {
        this.failCalls = failCalls;
    }

    public Long getFailCalls() 
    {
        return failCalls;
    }

    public void setAvgResponseTime(Long avgResponseTime) 
    {
        this.avgResponseTime = avgResponseTime;
    }

    public Long getAvgResponseTime() 
    {
        return avgResponseTime;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("apiId", getApiId())
            .append("userId", getUserId())
            .append("apiKey", getApiKey())
            .append("callDate", getCallDate())
            .append("totalCalls", getTotalCalls())
            .append("successCalls", getSuccessCalls())
            .append("failCalls", getFailCalls())
            .append("avgResponseTime", getAvgResponseTime())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .toString();
    }
}
